package com.dong.cloud.feign;

import com.dong.springcloud.entities.CommonResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * @author DJ
 * @description
 * @date 2022/1/12 10:22 下午
 **/
@Component
@FeignClient("cloud-payment-service")
public interface PaymentFeignService {

    /**
     * 通过openfeign调用微服务接口提供者
     *
     * @param id
     * @return com.dong.springcloud.entities.CommonResult
     * @author DJ
     * @date 10:24 下午 2022/1/12
     **/
    @GetMapping("payment/get/{id}")
    CommonResult getPaymentById(@PathVariable(value = "id") Long id);


    /**
     * 长流程调用 模拟feign超时的情况
     *
     * @param
     * @return java.lang.String
     * @author DJ
     * @date 10:37 下午 2022/1/12
     **/
    @GetMapping("payment/feign/timeout")
    String feignTimeout();
}
